/*
*	creat:2016/8/23
*	author:meichao
*/

/*
* gloab
*/
$baseSize:16px;

@mixin showborderColor($color: transparent) { //border色值
    border-color: $color;
}
@mixin showbackgroundColor($color: transparent) {   //  背景色
    background-color: $color;
}

*{
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  &:before,&:after{
    box-sizing: border-box;
  }
}

/*
* MButton
*/

.M-btn{
  outline: 0;
  display: inline-block;
  margin: 5px;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
  padding: $baseSize*0.25 $baseSize;
  font-size: $baseSize*0.75;
  border-radius: 6px;
  user-select: none;
  transition: all .3s cubic-bezier(.645,.045,.355,1);
  transform: translateZ(0);
  color: #666;
  @include showbackgroundColor(#f7f7f7);
  @include showborderColor(#d9d9d9);
  &:hover{
    outline: 0;
    color: #57c5f7;
    @include showbackgroundColor(#fff);
    @include showborderColor(#57c5f7);
  }
  &:before{
    position: absolute;
    top: -1px;
    left: -1px;
    bottom: -1px;
    right: -1px;
    background: #fff;
    opacity: .35;
    content: '';
    border-radius: inherit;
    z-index: 1;
    transition: opacity .2s;
    pointer-events: none;
    display: none;
  }
  &:active{
    box-shadow:0 0 16px #57c5f7;
  }

}
.M-btn-primary{
  color: #fff;
  @include showbackgroundColor(#2db7f5);
  @include showborderColor(#2db7f5);
  &:hover{
    color: #fff;
    @include showbackgroundColor(#57c5f7);
    @include showborderColor(#57c5f7);
  }
  &:active{
    color: #fff;
    @include showbackgroundColor(#2db7f5);
    @include showborderColor(#2db7f5);
  }
}
.M-btn-ghost{
    color: #666;
    @include showbackgroundColor();
    @include showborderColor(#d9d9d9);
    &:hover {
      color: #57c5f7;
      @include showbackgroundColor();
      @include showborderColor(#57c5f7);
    }
}
.M-btn-dashed{
    color: #666;
    @include showbackgroundColor()
    @include showborderColor(#d9d9d9);
    border-style: dashed;
}
.M-btn-sm{
  padding: 1px 7px;
  font-size: $baseSize*0.75;
  border-radius: $baseSize*0.25;
}
.M-btn-lg{
  padding: 4px 15px 5px;
  font-size: $baseSize*0.875;
  border-radius: $baseSize*0.375;
}
// MButton Group
.M-btn-group{
  display: inline-block;
  vertical-align: middle;
  position: relative;
  .M-btn:hover{
    z-index: 2;
  }
  /*.M-btn+.M-btn {
    margin-left: -1px;
  }*/
  .M-btn:first-child{
    margin-left: 0;
  }
  .M-btn:first-child:not(:last-child) {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    padding-right: 8px;
  }
  .M-btn:last-child:not(:first-child) {
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    padding-left: 8px;
  }
  .M-btn:not(:first-child):not(:last-child){
    border-radius: 0;
  }
  .M-btn-primary:first-child:not(:last-child) {
    border-right-color: #2baee9;
  }
  .M-btn-group .M-btn-primary+.M-btn, .M-btn-group .M-btn-primary:last-child:not(:first-child) {
    border-left-color: #2baee9;
  }
}

/*
* MTooltip
*/

.M-tooltip{
  display: inline-block;
  position: relative;
  &:hover .M-tooltip-inner{
    opacity: 1;
    visibility: visible;
  }
}
.M-tooltip-inner{
  white-space:nowrap;  
  visibility: hidden;
  font-size: 13px;
  padding: 6px 12px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  @include showbackgroundColor(#4b4b4b);
  border-radius: 5px;
  opacity: 0;
  transition: opacity .7s cubic-bezier(.645,.045,.355,1);
}
.M-tooltip-arrow{
  position: absolute;
  width: 0;
  height: 0;
  @include showborderColor()
  border-style: solid;
}
// 左边
.M-tooltip-leftTop,.M-tooltip-left,.M-tooltip-leftBottom{
  position: absolute;
  right: 100%;
  margin-right: 12px;
  .M-tooltip-arrow{
    border-width: 5px 0 5px 5px;
    border-left-color: #4b4b4b;
  }
}
.M-tooltip-leftTop{
  top: 0;
  right: 100%;
  .M-tooltip-arrow{
    right: -5px;
  }
}
.M-tooltip-left{
  top: 50%;transform:translateY(-50%);
  right: 100%;
  .M-tooltip-arrow{
    top: 50%;
    margin-top:-5px;
    right: -5px;
  }
}
.M-tooltip-leftBottom{
  right: 100%;
  bottom: 0;
  .M-tooltip-arrow{
    bottom: 5px;
    right: -5px;
  }
}
// 上边
.M-tooltip-default,.M-tooltip-top,.M-tooltip-topLeft,.M-tooltip-topRight{
  position: absolute;
  bottom: 100%;
  margin-bottom: 12px;
  .M-tooltip-arrow{
    bottom: -5px;
    margin-left: -5px;
    border-width: 5px 5px 0;
    border-top-color: #4b4b4b;
  }
}
.M-tooltip-topLeft{
  left: 0;
  .M-tooltip-arrow{
    left: 9px;
  }
}
.M-tooltip-default,.M-tooltip-top{
  left: 50%;
  transform:translateX(-50%);
  .M-tooltip-arrow{
    left: 50%;
  }
}
.M-tooltip-topRight{
  right: 0;
  .M-tooltip-arrow{
    right: 9px;
  }
}
// 右边
.M-tooltip-rightTop,.M-tooltip-right,.M-tooltip-rightBottom{
  position: absolute;
  left: 100%;
  margin-left: 12px;
  .M-tooltip-arrow{
    border-width: 5px 5px 5px 0;
    border-right-color: #4b4b4b;
  }
}
.M-tooltip-rightTop{
  top: 0;
  .M-tooltip-arrow{
    left: -5px;
  }
}
.M-tooltip-right{
  top: 50%;transform:translateY(-50%);
  .M-tooltip-arrow{
    top: 50%;
    margin-top:-5px;
    left: -5px
  }
}
.M-tooltip-rightBottom{
  bottom: 0;
  .M-tooltip-arrow{
    bottom: 5px;
    left: -5px
  }
}
// 底部
.M-tooltip-bottomLeft,.M-tooltip-bottom,.M-tooltip-bottomRight{
  position: absolute;
  top: 100%;
  margin-top: 12px;
  .M-tooltip-arrow{
    top: -5px;
    margin-left: -5px;
    border-width: 0 5px 5px;
    border-bottom-color: #4b4b4b;
  }
}
.M-tooltip-bottomLeft{
  left: 0;
  .M-tooltip-arrow{
    left: 9px;
  }
}
.M-tooltip-bottom{
  left: 50%;transform:translateX(-50%);
  .M-tooltip-arrow{
    left: 50%;
  }
}
.M-tooltip-bottomRight{
  right: 0;
  .M-tooltip-arrow{
    right: 9px;
  }
}

/*
* MInput
*/
.M-input-wrapper{
  width: 100px;
  .M-input-lg{
    padding: 6px 7px;
    height: 30px;
  }
  .M-input-sm {
    padding: 1px 7px;
    height: 22px;
    border-radius: 4px;
  }
}
.M-input {
  position: relative;
  display: inline-block;
  padding: 4px 7px;
  width: 100%;
  height: 28px;
  cursor: text;
  font-size: 12px;
  line-height: 1.5;
  color: #666;
  background-color: #fff;
  background-image: none;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  transition: border .2s cubic-bezier(.645,.045,.355,1),background .2s cubic-bezier(.645,.045,.355,1),box-shadow .2s cubic-bezier(.645,.045,.355,1);
  &:focus,&:hover {
    outline: none;
    border-color: #57c5f7;
  }
  &:focus{
    @include showbackgroundColor(#fff);
    @include showborderColor(#57c5f7);
    box-shadow:0 0 $baseSize*0.5 #57c5f7;
  }
}

/*
* MBackTop
*/
.M-back-top{
  text-align: center;
  position: fixed;
  right: 50px;
  z-index: 1000;
  bottom: 150px;
  background: rgba(151,151,151,.8);
  display: inline-block;
  padding: 5px;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  line-height: 1.5;
  cursor: pointer;
  transition:all .2s cubic-bezier(.645,.045,.355,1);
  visibility: hidden;
}
.M-back-top:hover{
  opacity: 0.7;
}
.M-in-top{
  visibility: visible;
}
.M-icon{
  display: inline-block;
  font-style: normal;
  vertical-align: baseline;
  text-align: center;
  text-transform: none;
  text-rendering: auto;
  line-height: 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/*
* MPagination
*/
.M-pagination{
  margin: 10px;
  list-style: none;
  font-size: 12px;
  .M-pagination-prev,.M-pagination-item,.M-pagination-next{
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    min-width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    list-style: none;
    float: left;
    border: 1px solid #d9d9d9;
    background-color: #fff;
    margin-right: 8px;
    font-family: Arial;
    &:hover{
      border-color:#108ee9;
      color: #108ee9;
    }
  }
  .M-pagination-next{
    margin-right: 0;
  }
  .M-pagination-options-size-changer{
    float: left;
    margin-left: 15px;
    margin-right: 10px;
  }
  .M-pagination-options-quick-jumper{
    float: left;
    height: 28px;
    line-height: 28px;
    input{
      width: 50px;
      margin-left: 5px;
    }
  }
  .M-pagination-item-active{
    background: #108ee9;
    color: #fff;
    border-color:#108ee9; 
    &:hover{
      color:#fff;
    }
  }
  .M-pagination-disabled{
    cursor: not-allowed;
  }
  &:after{
    content: " ";
    display: block;
    height: 0;
    clear: both;
    overflow: hidden;
    visibility: hidden;
  }
}

/*
* MSelect
*/
.M-select{
  display: inline-block;
  position: relative;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  user-select: none;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  transition: all .3s cubic-bezier(.645,.045,.355,1);
  &:hover{
    border-color: #40a5ed;
  }
  .M-select-selection{
    display: block;
    z-index: 1;
    padding: 0 8px;
    position: relative;
    line-height: 26px;
    .M-select-selection-selected{
      float: left;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 100%;
      padding-right: 14px;
    }
    &:after{
      content: '.';
      visibility: hidden;
      pointer-events: none;
      display: inline-block;
      width: 0;
    }
  }
  .M-select-allow{
    filter: none;
    font-style: normal;
    vertical-align: baseline;
    text-align: center;
    text-transform: none;
    text-rendering: auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: absolute;
    top: 50%;
    right: 8px;
    line-height: 1;
    margin-top: -5px;
    display: inline-block;
    font-size: 12px;
    font-size: 9px \9;
    transition: transform 0.2s ease;
    transform: scale(0.75) rotate(0deg);
    zoom: 1;
  }
  .M-select-dropdown{
    background-color: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    z-index: 1050;
    position: absolute;
    outline: none;
    overflow: hidden;
    font-size: 12px;
    left: 0;
    top: 100%;
    margin-top: 4px;
    width: 100%;
    opacity: 0;
    transition: all 0.4s ease;
    .M-select-dropdown-menu{
      outline: none;
      margin-bottom: 0;
      padding-left: 0;
      list-style: none;
      max-height: 250px;
      overflow: auto;
      .M-select-dropdown-menu-item{
        position: relative;
        display: block;
        padding: 7px 16px;
        font-weight: normal;
        color: #666;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        transition: background 0.4s ease;
        &:hover{
          background: #e7f4fd;
        }
      }
      .M-select-dropdown-menu-item-selected{
        background-color: #f7f7f7;
        font-weight: bold;
        &:hover{
          background-color: #f7f7f7;
          font-weight: bold;
        }
      }
    }
  }
}
.M-select-lg{
  .M-select-selection{
    line-height: 30px;
  }
}
.M-select-sm{
  .M-select-selection{
    line-height: 20px;
  }
}
.M-select-open{
  border-color: #40a5ed;
  outline: 0;
  box-shadow: 0 0 0 2px rgba(16, 142, 233, 0.2);
  .M-select-allow{
    transform:scale(0.75) rotate(180deg);
  }
}


/*
* MTable
*/
.M-table{
  font-size: 12px;
  color: rgba(0, 0, 0, 0.65);
  overflow: hidden;
  position: relative;
  border-radius: 4px 4px 0 0;
  .M-table-body{
    transition: opacity 0.3s ease;
  }
  table{
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
  }
}
.M-table-thead{
  >tr{
    transition: all .3s ease;
    >th{
        background: #f7f7f7;
        font-weight: bold;
        transition: background .3s ease;
        text-align: left;
        padding: 16px 8px;
        word-break: break-all;
    }
  }
}
.M-table-tbody{
  >tr{
    transition: all .3s ease;
    >td{
      border-bottom: 1px solid #e9e9e9;
      padding: 16px 8px;
      word-break: break-all;
    }
    &:hover{
      background: #ecf6fd;
    }
  }
}
.M-table-pagination{
  margin: 16px 0;
  float: right;
}
